#include <iostream>
#include <iomanip>
using namespace std;

// 1. 内联函数，计算平方
inline double square(double x) {
    return x * x;
}

// 2. 带默认参数的函数，计算幂次
double power(double base, int exponent = 2) {
    double result = 1;
    for (int i = 0; i < exponent; ++i) {
        result *= base;
    }
    return result;
}

// 3. 重载函数，处理 double 类型
double calc(double a, double b, char op) {
    if (op == '+') return a + b;
    if (op == '-') return a - b;
    if (op == '*') return a * b;
    if (op == '/') {
        if (b == 0) {
            cout << "Error: divide by zero" << endl;
            return 0; 
        }
        return a / b;
    }
    return 0; 
}

// 3. 重载函数，处理 int 类型
double calc(int a, int b, char op) {
    if (op == '+') return a + b;
    if (op == '-') return a - b;
    if (op == '*') return a * b;
    if (op == '/') {
        if (b == 0) {
            cout << "Error: divide by zero" << endl;
            return 0; 
        }
        return a / b;
    }
    return 0; 
}

int main() {
    double num1, num2;
    char op;
    cin >> num1 >> num2 >> op;

    // 调用 square 函数
    cout << fixed << setprecision(2);
    cout << "square(" << num1 << ") = " << square(num1) << endl;

    // 调用 power 函数，这里演示传入两个参数（覆盖默认指数）
    // 注意：题目示例中 power(3,3) 是取 num2 为指数，因此直接用 num2
    cout << "power(" << num1 << "," << num2 << ") = " << power(num1, static_cast<int>(num2)) << endl;

    // 调用 calc 函数，根据输入数的类型匹配重载
    if (static_cast<int>(num1) == num1 && static_cast<int>(num2) == num2) {
        cout << num1 << " " << op << " " << num2 << " = " << calc(static_cast<int>(num1), static_cast<int>(num2), op) << endl;
    } else {
        cout << num1 << " " << op << " " << num2 << " = " << calc(num1, num2, op) << endl;
    }

    return 0;
}